<template>
  <!--待使用页面-->
  <div class="guibinting order">
    <div class="msg" v-for="item in accountGoodsList">
      <div class="weui-media-box weui-media-box_appmsg">
        <div class="weui-media-box__hd">
          <img :src="item.coverImg|imgPathFilter" alt="" class="weui-media-box__thumb">
        </div>
        <div class="weui-media-box__bd">
          <h4 class="weui-media-box__title">{{item.goodsName}}</h4>
          <p class="weui-media-box__desc" v-if="item.sourceType!=6">{{item.payAmount}}元</p>
          <p class="weui-media-box__desc" v-if="item.sourceType==6">{{item.payAmount}}积分</p>
        </div>
        <span class="num">×{{item.goodsNum}}</span>
      </div>
      <p class="status" @click="goSaomaDetail(item.accountGoodsId)">
        <button class="weui-btn weui-btn_plain-default">去使用</button>
      </p>
    </div>
    <p class="nomore">没有更多了</p>
  </div>
</template>

<script type="text/ecmascript-6">
  import {getAccountGoodsListNotUsed} from '../../../../test/unit/http'
  import {Toast} from 'we-vue'
  export default {
    name: 'notuse',
    props: {},
    data() {
      return {
        activeIndex: 0,
        thumb: require('../../../assets/lipinjinka.png'),
        accountGoodsList: []
      };
    },
    methods: {
      goSaomaDetail(accountGoodsId){
          this.$router.push({path:'saomadetail',query:{accountGoodsId:accountGoodsId}})
      },
      getAccountGoodsListNotUsedData(params){
        getAccountGoodsListNotUsed(params).then(res => {
          console.log(res);
          if (res.code == 100) {
            this.accountGoodsList = res.object.rows;
          }
        });
      }
    },
    created() {
      this.getAccountGoodsListNotUsedData({})
    },
    components: {}
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less" rel="stylesheet/less">
  .weui-panel:before {
    border-top: none;
  }

  .nomore {
    color: #999;
    padding: 10px;
  }

  input::-webkit-input-placeholder {
    color: #999;
    font-size: 14px;
  }

  .msg {
    position: relative;
    border-bottom: 1px solid #eee;
    padding: 0 10px 10px;
    .order_list:not(:last-of-type) {
      padding-bottom: 10px;
      border-bottom: 1px solid #eee;
    }
    .all {
      border-top: 1px solid #eee;
      padding-top: 10px;
      margin-top: 10px;
      .money {
        color: #ff8551;
        float: left;
        margin-top: 5px;
      }
    }
    .state {
      color: #e96774;
      font-size: 12px;
      margin-left: 5px;
    }
    .yuyueing {
      font-size: 10px;
      color: #fff;
      background-color: #ccc;
      border-radius: 25px;
      padding: 5px 15px;
      margin-left: 5px;
    }
    .suc {
      background-color: #3095f0;
    }
    .fail {
      background-color: #e96775;
    }
    .num {
      font-size: 15px;
      color: #666;
      margin-top: 55px;
    }
    .status {
      font-size: 12px;
      text-align: right;
      padding-right: 15px;
      .success {
        color: #999;
      }
      .daifu {
        color: #ff8551;
      }
      button {
        border-radius: 25px;
        display: inline-block;
        width: 72px;
        font-size: 15px;
        color: #111;
        margin-left: 10px;
        line-height: 1.6
      }
    }
  }

  .order {
    margin-bottom: 50px;
  }

  .weui-btn {
    padding: 0 5px;
  }

  .weui-btn + .weui-btn {
    margin-top: 0;
  }
</style>

